package com.zs.admin.vo.wisdbook;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.zs.common.util.StringUtils;
import com.zs.common.util.YmlUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

@Data
@ApiModel("智书书页列表Vo")
public class WisdbookPageListedVo implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "")
    private Integer id;

    @ApiModelProperty(value = "智书id")
    private Integer bookId;

    @ApiModelProperty(value = "页名称")
    private String pageName;

    @ApiModelProperty(value = "页图地址")
    private String pageImg;

    @ApiModelProperty(value = "页码")
    private Integer pageNum;

    @ApiModelProperty(value = "该页类型：封面、封底、版权页、正文页、参考答案页、目录页")
    private String pageType;

    @JsonIgnore
    @ApiModelProperty(value = "")
    private String createTime;

    @JsonIgnore
    @ApiModelProperty(value = "")
    private String updateTime;

    public String getPageImg() {
        String https = YmlUtils.get("ossResource.https");
        if(StringUtils.isNotEmpty(pageImg)){
            return https+pageImg;
        }
        return pageImg;
    }
}
